<?php
/**
 * @Author: Marte
 * @Date:   2017-08-21 07:19:51
 * @Last Modified by:   Marte
 * @Last Modified time: 2017-08-21 17:44:16
 *
 */

?>
<div class="novel">
    <span class="novel_title">全部小说
    <?php if(isset($_GET['searchresult'])&&$_GET['searchresult']==1)
    {
        echo '<a href="admin_index.php?type=3" title="">返回</a>';
    }
    ?>
    <span>共有<?php echo $_num1;?>本书</span></span>
    <form action="book_search.php" method="post" accept-charset="utf-8">
    <input class="search" type="text" name="search" >
    <input class="submit" type="submit" name="submit" value="搜索">
     <table border="1">
                <thead>
                    <tr>
                    <th class="type">类型</th>
                    <th class="name">书名</th>
                    <th class="author">作者</th>
                    <th class="words">字数</th>
                    <th class="status">状态</th>
                    <th class="time">上架时间</th>
                    <th class="dell">下架</th>
                    <th class="vip">升级为VIP</th>
                    </tr>
                </thead>
                <tbody>
                <?php
                    if(!isset($_GET['searchresult'])||$_GET['searchresult']!=1)
                    {

                ?>
                <?php

                    while($_assoc5=$_resultt3->fetch_assoc())
                    {
                ?>

                         <tr>
                        <td>
                             <?php
                    $_p=$_assoc5['typeid'];
                    switch($_p)
                    {
                                    case 1:echo "玄幻" ;break;
                                    case 2:echo "奇幻";break;
                                    case 3:echo "武侠";break;
                                    case 4:echo "仙侠";break;
                                    case 5:echo "都市";break;
                                    case 6:echo "现实";break;
                                    case 7:echo "历史";break;
                                    case 8:echo "军事";break;
                                    case 9:echo "校园";break;
                                    case 10:echo "游戏";break;
                                    case 11:echo "言情";break;
                                    case 12:echo "灵异";break;
                                    case 13:echo "N次元";break;
                    }
                ?>
                        </td>
                        <td><?php echo $_assoc5['bookname']?></td>
                        <td><?php echo $_assoc5['bookauthor']?></td>
                        <td><?php echo $_assoc5['words']?>万</td>
                        <td> <?php
                    $_p=$_assoc5['isend'];
                    switch($_p)
                    {
                                    case 1:echo "完结" ;break;
                                    case 0:echo "连载中";break;

                    }
                ?></td>
                        <td><?php echo $_assoc5['time']?></td>
                        <td class="dell"><a href="admin_index.php?type=3&delete1=1&id=<?php echo $_assoc5['bookid'];?>" title="">下架</a></td>
                        <td class="vip">
                        <?php
                            if($_assoc5['isvip']=='1')
                            {
                                echo '<a href="admin_index.php?type=3" title="">VIP</a>';
                            }
                            else
                            {
                                echo '<a href="admin_index.php?type=3&top=1&id='.$_assoc5['bookid'].'" title="">升为VIP</a>';
                            }
                        ?>


                        </td>  </tr>

                <?php
                         }

                ?>
                    <?php
                         }else
                            {
                                $_sql9='select bookid,typeid,bookname,bookauthor,words,isend,time,isshow,isvip from books where bookid="'.$_GET['id'].'"';
                                $_result9=$_mysql->query($_sql9);
                                $_assoc9=$_result9->fetch_assoc();
                    ?>
                          <tr>
                        <td>
                             <?php
                    $_p=$_assoc9['typeid'];
                    switch($_p)
                    {
                                    case 1:echo "玄幻" ;break;
                                    case 2:echo "奇幻";break;
                                    case 3:echo "武侠";break;
                                    case 4:echo "仙侠";break;
                                    case 5:echo "都市";break;
                                    case 6:echo "现实";break;
                                    case 7:echo "历史";break;
                                    case 8:echo "军事";break;
                                    case 9:echo "校园";break;
                                    case 10:echo "游戏";break;
                                    case 11:echo "言情";break;
                                    case 12:echo "灵异";break;
                                    case 13:echo "N次元";break;
                    }
                ?>
                        </td>
                        <td><?php echo $_assoc9['bookname']?></td>
                        <td><?php echo $_assoc9['bookauthor']?></td>
                        <td><?php echo $_assoc9['words']?>万</td>
                        <td> <?php
                    $_p=$_assoc9['isend'];
                    switch($_p)
                    {
                                    case 1:echo "完结" ;break;
                                    case 0:echo "连载中";break;

                    }
                ?></td>
                        <td><?php echo $_assoc9['time']?></td>
                        <td class="dell"><a href="admin_index.php?type=3&delete1=1&id=<?php echo $_assoc9['bookid'];?>" title="">下架</a></td>
                        <td class="vip">
                        <?php
                            if($_assoc9['isvip']=='1')
                            {
                                echo '<a href="admin_index.php?type=3" title="">VIP</a>';
                            }
                            else
                            {
                                echo '<a href="admin_index.php?type=3&top=1&id='.$_assoc9['bookid'].'" title="">升为VIP</a>';
                            }
                        ?>


                        </td>  </tr>


                        <?php

                            }
                            ?>
                </tbody>
<?php
 // echo '<a class="back" href="admin_index.php?type=3" title="">返回列表</a>';
?>

            </table>
            <div class="num2">
              <?php
                for($i=0;$i<$_pagesnum2;$i++)
                {
                  echo '<a href="admin_index.php?type=3&page2='.($i+1).'">'.($i+1).'</a>';
                }
                echo '<a href="admin_index.php?type=3&page='.($_page2+1).'" >></a>';
            ?>
            </div>
</form>
</div>